import type { FormSchema } from '@/components/core/schema-form/';

export const deptSchema = (): FormSchema<API.CreateDeptParams>[] => [
  {
    field: 'name',
    component: 'Input',
    label: '部门名称',
    rules: [{ required: true }],
  },
  {
    field: 'code',
    component: 'Input',
    label: '部门编码',
    rules: [{ required: true }],
  },
  {
    field: 'orgId',
    component: 'TreeSelect',
    label: '所属组织',
    componentProps: {
      fieldNames: {
        label: 'name',
        value: 'id',
      },
      getPopupContainer: () => document.body,
    },
    rules: [{ required: true, type: 'string' }],
  },
  {
    field: 'parentId',
    component: 'TreeSelect',
    label: '上级部门',
    componentProps: {
      fieldNames: {
        label: 'name',
        value: 'id',
      },
      getPopupContainer: () => document.body,
    },
  },
  {
    field: 'deptLeader',
    component: 'Input',
    label: '部门领导',

  },
  {
    field: 'parentLeader',
    component: 'Input',
    label: '上级部门领导',

  },
  {
    field: 'shortName',
    component: 'Input',
    label: '部门简称',
  },
  {
    field: 'phoneNumber',
    component: 'Input',
    label: '部门电话',
  },
  {
    field: 'postAddress',
    component: 'Input',
    label: '邮寄地址',
  },
  {
    field: 'mainPost',
    component: 'Input',
    label: '主岗位',
  },
  {
    field: 'staff',
    component: 'Input',
    label: '职务',
  },
  {
    field: 'IS_ENABLED',
    component: 'RadioGroup',
    label: '是否启用',
    defaultValue: 1,
    componentProps: {
      options: [
        {
          label: '启用',
          value: 1,
        },
        {
          label: '禁用',
          value: 0,
        },
      ],
    },
  },
  {
    field: 'IS_BUSINESS',
    component: 'RadioGroup',
    label: '是否与业务相关',
    defaultValue: 0,
    componentProps: {
      options: [
        {
          label: '是',
          value: 1,
        },
        {
          label: '否',
          value: 0,
        },
      ],
    },
  },
  {
    field: 'orgTags',
    component: 'Input',
    label: '机构标签',
  },
  {
    field: 'keyWords',
    component: 'Input',
    label: '关键字',
    rules: [{ required: true, type: 'string' }],
  },
  {
    field: 'orgSort',
    component: 'Input',
    label: '排序号',
  },
  {
    field: 'remark',
    component: 'InputTextArea',
    label: '备注',
  },
];
type blankDataType=API.CreateDeptParams;
export const blankData:blankDataType={
    /**
         * 组织ID
         */
    id: '',
    /**
     * 机构名称
     */
    name: '',
    /**
     * 部门编码
     */
    code: '',
    /**
     * 部门简称
     */
    shortName: '',
    /**
     * 部门电话
     */
    phoneNumber: '',
    /**
     * 上级ID
     */
    parentId: '',
    /**
     * 所属组织
     */
    orgId: '',
    /**
     * 上级领导
     */
    parentLeader: '',
    /**
     * 部门领导
     */
    deptLeader: '',
    /**
     * 邮寄地址
     */
    postAddress: '',
    /**
     * 主岗位
     */
    mainPost: '',
    /**
     * 职务
     */
    staff: '',
    /**
     * 组织标签
     */
    orgTags: '',
    /**
     * 关键字
     */
    keyWords: '',
    /**
     * 是否启用
     */
    IS_ENABLED: undefined,
    /**
     * 是否业务相关
     */
    IS_BUSINESS: undefined,
    /**
     * 排序号
     */
    orgSort: undefined,
    /**
     * 备注
     */
    remark: '',
};



